luci-mod-network: organize "limits" tab in dhcp/dns views
authorDavid Härdeman <[email protected]>
Wed, 15 Oct 2025 16:43:03 +0000 (18:43 +0200)
committerPaul Donald <[email protected]>
Sat, 18 Oct 2025 21:51:38 +0000 (23:51 +0200)
Sort the options in the "limits" tab so that they are all grouped together in
the order they appear in the UI and delete ones that are specific to DNS from
dhcp.js and vice versa.

Only one option is relevant to the dhcp view, so move it to the "general" tab.

Signed-off-by: David Härdeman <[email protected]>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js

index 2c227592cead73dc6aea87ede5db4fbc0022b53b..4f915c2661a35867b139a6b5b540b31fb5c1c6fb 100644 (file)
@@ -391,7 +391,6 @@ return view.extend({
 
                s.tab('general', _('General'));
                s.tab('devices', _('Devices &amp; Ports'));
-               s.tab('limits', _('Limits'));
                s.tab('logging', _('Log'));
                s.tab('files', _('Resolv &amp; Hosts Files'));
                s.tab('leases', _('Static Leases'));
@@ -412,6 +411,13 @@ return view.extend({
                        _('Allocate IPs sequentially'),
                        _('Allocate IP addresses sequentially, starting from the lowest available address.'));
                o.optional = true;
+
+               o = s.taboption('general', form.Value, 'dhcpleasemax',
+                       _('Max. DHCP leases'),
+                       _('Maximum allowed number of active DHCP leases.'));
+               o.optional = true;
+               o.datatype = 'uinteger';
+               o.placeholder = 150;
                // End general
 
                // Begin devices
@@ -585,47 +591,6 @@ return view.extend({
                o.optional = true;
                o.depends('logdhcp', '0');
 
-               o = s.taboption('limits', form.Value, 'dhcpleasemax',
-                       _('Max. DHCP leases'),
-                       _('Maximum allowed number of active DHCP leases.'));
-               o.optional = true;
-               o.datatype = 'uinteger';
-               o.placeholder = 150;
-
-               o = s.taboption('limits', form.Value, 'ednspacket_max',
-                       _('Max. EDNS0 packet size'),
-                       _('Maximum allowed size of EDNS0 UDP packets.'));
-               o.optional = true;
-               o.datatype = 'uinteger';
-               o.placeholder = 1280;
-
-               o = s.taboption('limits', form.Value, 'dnsforwardmax',
-                       _('Max. concurrent queries'),
-                       _('Maximum allowed number of concurrent DNS queries.'));
-               o.optional = true;
-               o.datatype = 'uinteger';
-               o.placeholder = 150;
-
-               o = s.taboption('limits', form.Value, 'cachesize',
-                       _('Size of DNS query cache'),
-                       _('Number of cached DNS entries, 10000 is maximum, 0 is no caching.'));
-               o.optional = true;
-               o.datatype = 'range(0,10000)';
-               o.placeholder = 150;
-
-               o = s.taboption('limits', form.Value, 'min_cache_ttl',
-                       _('Min cache TTL'),
-                       _('Extend short TTL values to the seconds value given when caching them. Use with caution.') +
-                       _(' (Max 1h == 3600)'));
-               o.optional = true;
-               o.placeholder = 60;
-
-               o = s.taboption('limits', form.Value, 'max_cache_ttl',
-                       _('Max cache TTL'),
-                       _('Set a maximum seconds TTL value for entries in the cache.'));
-               o.optional = true;
-               o.placeholder = 3600;
-
                o = s.taboption('pxe_tftp', form.Flag, 'enable_tftp',
                        _('Enable TFTP server'),
                        _('Enable the built-in single-instance TFTP server.'));
index 079fa1e2746fdf4ec506ef667c11c4306e7965f6..659a8242f7dd4b137da32fd8ffd775267d2e99d0 100644 (file)
@@ -918,6 +918,41 @@ return view.extend({
                        _('Remove any subnet address already present in a downstream query before forwarding it upstream.'));
                // End forward
 
+               // Begin limits
+               o = s.taboption('limits', form.Value, 'ednspacket_max',
+                       _('Max. EDNS0 packet size'),
+                       _('Maximum allowed size of EDNS0 UDP packets.'));
+               o.optional = true;
+               o.datatype = 'uinteger';
+               o.placeholder = 1280;
+
+               o = s.taboption('limits', form.Value, 'dnsforwardmax',
+                       _('Max. concurrent queries'),
+                       _('Maximum allowed number of concurrent DNS queries.'));
+               o.optional = true;
+               o.datatype = 'uinteger';
+               o.placeholder = 150;
+
+               o = s.taboption('limits', form.Value, 'cachesize',
+                       _('Size of DNS query cache'),
+                       _('Number of cached DNS entries, 10000 is maximum, 0 is no caching.'));
+               o.optional = true;
+               o.datatype = 'range(0,10000)';
+               o.placeholder = 150;
+
+               o = s.taboption('limits', form.Value, 'min_cache_ttl',
+                       _('Min cache TTL'),
+                       _('Extend short TTL values to the seconds value given when caching them. Use with caution.') +
+                       _(' (Max 1h == 3600)'));
+               o.optional = true;
+               o.placeholder = 60;
+
+               o = s.taboption('limits', form.Value, 'max_cache_ttl',
+                       _('Max cache TTL'),
+                       _('Set a maximum seconds TTL value for entries in the cache.'));
+               o.optional = true;
+               o.placeholder = 3600;
+               // End limits
 
                o = s.taboption('logging', form.Flag, 'logqueries',
                        _('Log queries'),
@@ -1068,47 +1103,6 @@ return view.extend({
                o.optional = true;
                o.depends('logdhcp', '0');
 
-               o = s.taboption('limits', form.Value, 'dhcpleasemax',
-                       _('Max. DHCP leases'),
-                       _('Maximum allowed number of active DHCP leases.'));
-               o.optional = true;
-               o.datatype = 'uinteger';
-               o.placeholder = 150;
-
-               o = s.taboption('limits', form.Value, 'ednspacket_max',
-                       _('Max. EDNS0 packet size'),
-                       _('Maximum allowed size of EDNS0 UDP packets.'));
-               o.optional = true;
-               o.datatype = 'uinteger';
-               o.placeholder = 1280;
-
-               o = s.taboption('limits', form.Value, 'dnsforwardmax',
-                       _('Max. concurrent queries'),
-                       _('Maximum allowed number of concurrent DNS queries.'));
-               o.optional = true;
-               o.datatype = 'uinteger';
-               o.placeholder = 150;
-
-               o = s.taboption('limits', form.Value, 'cachesize',
-                       _('Size of DNS query cache'),
-                       _('Number of cached DNS entries, 10000 is maximum, 0 is no caching.'));
-               o.optional = true;
-               o.datatype = 'range(0,10000)';
-               o.placeholder = 150;
-
-               o = s.taboption('limits', form.Value, 'min_cache_ttl',
-                       _('Min cache TTL'),
-                       _('Extend short TTL values to the seconds value given when caching them. Use with caution.') +
-                       _(' (Max 1h == 3600)'));
-               o.optional = true;
-               o.placeholder = 60;
-
-               o = s.taboption('limits', form.Value, 'max_cache_ttl',
-                       _('Max cache TTL'),
-                       _('Set a maximum seconds TTL value for entries in the cache.'));
-               o.optional = true;
-               o.placeholder = 3600;
-
                o = s.taboption('pxe_tftp', form.Flag, 'enable_tftp',
                        _('Enable TFTP server'),
                        _('Enable the built-in single-instance TFTP server.'));